.. This file was automatically converted from MediaWiki syntax. If some markup is wrong, looks weird or doesn't make sense, feel free to fix it. Please remove this comment once this file was manually checked and no "strange ReST" artifacts remain. .. _texturing-in-cxx: Texturing in CXX ================ .. only:: python This page is related to C++ usage of Panda3D and not to Python usage. If you are a Python user, please skip this page. For C++ users, please toggle to the C++ version of this page. .. only:: cxx Texturing in C++ ================ Panda's C++ interface to texturing is basically the same as it's Python interface, That's why it is very recommended to read the entire section including the Python examples. However, there are two major differences, which are explained in this page. 1. C++ does not have a loader.loadTexture. You need to use the TexturePool to load textures. Please note that the Texture class is :ref:`reference-counted`. .. code-block:: cpp include "texturePool.h" PT(Texture) tex; tex = TexturePool::load_texture("maps/noise.rgb"); NodePath smiley; smiley = window->load_model(window->get_render(),"smiley.egg"); smiley.set_texture(tex, 1); 2. You don't directly need CardMaker to display your texture in a 2D or 3D scene. You can load it as if it were a model, and treat it like any other model. .. code-block:: cpp NodePath noiseplane; noiseplane = window->load_model(window->get_render(), "maps/noise.rgb"); This short piece of code will result in a single polygon in the scene with the noise texture applied to it. If you need it in the 2d scene, you can use get\_aspect2d() or get\_render2d() instead of get\_render().